package com.dayang.nm.ugcaudit.action;

import java.io.PrintWriter;
import java.lang.reflect.Method;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.dayang.baseplatform.model.CommonDisplay;
import com.dayang.baseplatform.service.ugcaudit.AuditListService;
import com.dayang.baseplatform.service.ugcaudit.KeyFrameListService;
import com.dayang.baseplatform.service.ugcaudit.KeyFrameService;

public class KeyFrameAction extends BaseAction {
	
	@Override
	public String create(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		return null;
	}

	@Override
	public String delete(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		return null;
	}

	@Override
	public String update(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		return null;
	}

	
	public byte[] read(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		String keyFramePath = request.getParameter("filePath");
		String timeCodeStr = request.getParameter("frame");
		String fileName = request.getParameter("fileName");
		
		KeyFrameService service = new KeyFrameService();
		byte data[] = service.read(keyFramePath,fileName);
		
		return data;
	}
	
}
